package com.community.handler;

import com.community.entity.Fix;
import com.community.json.JsonResult;
import com.community.service.FixService;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("html/fix")
public class FixHandler {
    @Resource
    private FixService fixService;

    @GetMapping("findAll")
    public JsonResult findAll(){
        System.out.println("查询所有的维修信息");
        JsonResult jsonResult = new JsonResult();
        List<Fix> fixList = fixService.findAll();
        jsonResult.setHttpCode(200);
        jsonResult.setData(fixList);
        return jsonResult;
    }

    @GetMapping("findByState")
    public JsonResult findByState(Integer payState){
        return null;
    }

    @DeleteMapping("deleteById")
    public JsonResult deleteById(Integer[] payIdList){
        return null;
    }
}
